﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Xml;
using MCMLXVII.BackEnd.Services.Common.Messages;

#endregion

namespace MCMLXVII.BackEnd.Services.OrganizationChart.Messages
{
    [Serializable()]
    public class msgUpdateOrganizationMember : IOrganizationTreeNodeOperation
    {
        private int _NodeID;

        private int _UpdateSequence;        
        public int UpdateSequence
        {
            get
            {
                return _UpdateSequence;
            }
            set
            {
                _UpdateSequence=value;
            }
        }

        private int _MemberID;
        public int MemberID
        {
            get
            {
                return _MemberID;
            }
            set
            {
                _MemberID=value;
            }

        }


        private string _Description;
        public string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                _Description=value;
            }
        }

        private msgXMLResponse _ClassProperties;
        public msgXMLResponse ClassProperties
        {
            get
            {
                return _ClassProperties;
            }
            set
            {
                _ClassProperties=value;
            }
        }

        private int _SecurityProviderID;
        public int SecurityProviderID
        {
            get
            {
                return _SecurityProviderID;
            }
            set
            {
                _SecurityProviderID=value;
            }
        }

        private string _LogonName;
        public string LogonName
        {
            get
            {
                return _LogonName;
            }
            set
            {
                _LogonName=value;
            }
        }

        private string _DirectoryIdentifier;
        public string DirectoryIdentifier
        {
            get
            {
                return _DirectoryIdentifier;
            }
            set
            {
                _DirectoryIdentifier=value;
            }
        }

        private string _Language;
        public string Language
        {
            get
            {
                return _Language;
            }
            set
            {
                _Language=value;
            }
        }

        private int _RoleMemberID;
        public int RoleMemberID
        {
            get
            {
                return _RoleMemberID;
            }
            set
            {
                _RoleMemberID=value;
            }
        }


        private int[] _MemberOf;
        public int[] MemberOf
        {
            get
            {
                return _MemberOf;
            }
            set
            {
                _MemberOf=value;
            }
        }



        public msgUpdateOrganizationMember()
        {

        }
        public msgUpdateOrganizationMember(int MemberID, int NodeID, string Description, XmlReader ClassProperties, int SecurityProviderID, string LogonName, string DirectoryIdentifier, string Language, int roleMemberID, int updateSequence, int[] memberOf)
        {
            _MemberID = MemberID;
            _ClassProperties = new msgXMLResponse(ClassProperties);
            _Description = Description;
            _DirectoryIdentifier = DirectoryIdentifier;
            _NodeID = NodeID;
            _Language = Language;
            _LogonName = LogonName;
            _SecurityProviderID = SecurityProviderID;
            _RoleMemberID = roleMemberID;
            _MemberOf = memberOf;
            _UpdateSequence = updateSequence;

        }
        public msgUpdateOrganizationMember(int memberID, int NodeID, string Description, int MemberClass, string ClassProperties, int SecurityProviderID, string LogonName, string DirectoryIdentifier, string Language, int roleMemberID, int updateSequence, int[] memberOf)
        {
            _ClassProperties = new msgXMLResponse(ClassProperties);
            _Description = Description;
            _DirectoryIdentifier = DirectoryIdentifier;
            _Language = Language;
            _NodeID = NodeID;
            _LogonName = LogonName;
            _MemberID = memberID;
            _UpdateSequence = updateSequence;
            _SecurityProviderID = SecurityProviderID;
            _RoleMemberID = roleMemberID;
            _MemberOf = memberOf;
        }

        public msgUpdateOrganizationMember(msgOrganizationMemberInfo inf)
        {
            _MemberID = inf.MemberID;
            _ClassProperties = inf.ClassProperties;
            _Description = inf.Description;
            _DirectoryIdentifier = inf.DirectoryIdentifier;
            _Language = inf.Language;
            _LogonName = inf.LogonName;
            _SecurityProviderID = inf.SecurityProviderID;
            _RoleMemberID = inf.RoleMemberID.MemberID;
            _MemberOf = new int[inf.MemberOf.Length];
            for (int i = 0; i < inf.MemberOf.Length; i++)
            {
                _MemberOf[i] = inf.MemberOf[i].MemberID;
            }
            _UpdateSequence = inf.UpdateSequence;
            _NodeID = inf.NodeID;

        }


        #region IOrganizationTreeNodeOperation Members
        public int NodeID
        {
            get { return _NodeID; }
            set { _NodeID = value; }
        }


        #endregion

    }

}
